-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Update rc.rs docs #140483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update rc.rs docs #140483
Conversation
`wrapped_add` is used, not `checked_add`
rustbot has assigned @workingjubilee. Use |
@@ -3536,7 +3536,7 @@ impl<T> Default for Weak<T> { | |||
} | |||
} | |||
|
|||
// NOTE: We checked_add here to deal with mem::forget safely. In particular | |||
// NOTE: We wrapping_add here to deal with mem::forget safely. In particular |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing in a different way: the wrapping_add
does not offer the protection anymore, the strong == 0
conditional does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the very least, it should mention clearly what actually implements the guard that handles the mem::forget
, if it's going to mention any code.
I think this requires more than a one-word change to make something that makes sense. At least in the current mistaken form it's obviously " @rustbot author |
Reminder, once the PR becomes ready for a review, use |
wrapped_add
is used, notchecked_add